feat(events): define v1 semantic route descriptors - #170
Conversation
Admit only the seven G10 event families, type their canonical/native props, and add Agent.Context as the immediate guidance vocabulary.
🦋 Changeset detectedLatest commit: a7f51a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7f51a7f06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| route.kind === 'event-route' | ||
| ? ` ${JSON.stringify(route.id)}: EventRouteContract<typeof route${String(index)}.default, ${JSON.stringify(route.event)}>;` |
There was a problem hiding this comment.
Separate event routes from input/result aliases
When a graph contains any newly admitted event route, this branch adds an EventRouteContract containing only component and event to AgentBundleRoutes, while the emitted RouteInput and RouteResult aliases at lines 47–48 still unconditionally index every RouteId by input and result. TypeScript therefore reports TS2536 while checking the generated routes.d.ts, preventing consumers from type-checking generated declarations for projects with event routes. Restrict those aliases to schema-based route IDs or extract the properties conditionally.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in #198 (merged as d992838). The generated declarations now route RouteInput/RouteResult through conditional ContractInput/ContractResult helpers: schema routes keep their schema-derived types, and event routes resolve the component's props and awaited return type instead of erroring on the missing input/result members. Covered by a typegen fixture test plus a type-level test that compiles the generated routes.d.ts and asserts exact resolution for both route kinds.
| export interface AgentEventRouteProps { | ||
| readonly canonical: AgentEventCanonicalIdentity; | ||
| readonly native: AgentEventNativePayload; | ||
| readonly signal: AbortSignal; |
There was a problem hiding this comment.
Pass the published event props from the route test harness
Consumers authoring against this new public contract cannot exercise their event routes through agent-bundle/test: componentProps in src/test/render.ts still passes { event, payload, signal } for event-route, rather than { canonical, native, signal }, and its event value is the prefixed route ID such as event:tool/after. Consequently, routes that destructure the newly documented canonical or native props receive undefined and may fail during route-unit rendering; the harness needs to construct the same canonical/native envelope promised here.
Useful? React with 👍 / 👎.
commit: |
Summary
src/events/stop.tsx<Agent.Context>to the Agent Document vocabulary and MCP text projectionEvidence table additions
Lane D coordination
Agent.Contextvocabulary node, decoder, exports, and projector supportTest plan
pnpm exec rstest run packages/rsc-runtime/tests/agent-document.test.ts packages/rsc-runtime/tests/dispatcher.test.ts packages/agent-bundle/tests/route-graph.test.ts packages/agent-bundle/tests/entry-shell.test.ts(56 passed)pnpm typecheckpnpm lintCloses part of #97